policy: Phase 0 non-destructive policy handling + current branch updates#11
Merged
Conversation
Grows the fixture dataset from ~5 nodes / 2 users to:
- 25 users (local, OIDC/Google, OIDC/Azure, OIDC/GitHub, service accounts,
long names, unicode display names, legacy epoch creation dates)
- 91 nodes distributed unevenly across users + tagged-devices:
- Group A: personal workstations/laptops (mixed online/offline, expiry states)
- Group B: 6 exit nodes (dual-stack approved, IPv4-only, IPv6-only,
unapproved, expiring soon, offline)
- Group C: 8 route-provider nodes (RFC1918 /24, /16, /8, overlapping
subnets, IPv6 ULA, dual-stack, pending approval, many-routes overflow)
- Group D: 22 tagged nodes under tagged-devices (single/multi tag,
k8s cluster, IoT, cameras, printers, orphaned nodes, never-seen node,
tagged exit node, tagged router)
- Group E: edge cases (null lastSeen, IPv4-only, IPv6-only addresses,
REGISTER_METHOD_UNSPECIFIED, multi-IP node, overflow name/givenName)
- 11 pre-auth keys (reusable, ephemeral, used, expired, tagged, multi-tag,
expiring-soon, service-account)
- 3 API keys (healthy, expiring-soon, expired)
- Richer ACL policy (groups, hosts, tagOwners, SSH rules)
- userNodeMap built dynamically from fixture data (includes originalUser
attribution for tagged-device nodes)
Smoke-tested via Docker: 25 users, 91 nodes, 11 preAuthKeys returned.
… preauth key selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR includes all files currently on branch
test/expand-mock-api-fixturesand targetsprivacyint/headscale-admin:main.It delivers the Phase 0 safety patch from
docs/headscale-0.29.x-agentic-workplan.mdwhile also carrying the branch's in-flight updates (UI/test/mock/openapi/tooling assets) as requested.Phase 0 changes (implemented)
1) Lossless policy document abstraction
src/lib/common/policy-document.tswith:parsePolicyDocument(...)mergeLegacyPolicyDocument(...)serialisePolicyDocument(...)2) Non-destructive save integration
src/lib/common/acl.svelte.ts:ACLBuilder.fromPolicy(...)now parses through policy document abstraction.ACLBuilder.JSON(...)now merges edited legacy sections into original raw policy before save.hasUnsupportedPolicyFields()getUnsupportedPolicyFields()3) Explicit compatibility warning UX
src/routes/acls/+page.sveltesrc/routes/acls/Config.svelte4) Unit tests for lossless round-trip
src/lib/common/policy-document.test.tscovering:grants,nodeAttrs,randomizeClientPort),Additional branch updates included (as requested)
This PR also includes the branch’s existing non-Phase-0 files:
.trunk/logo.svg)Files changed
.trunk/.gitignore.trunk/configs/.hadolint.yaml.trunk/configs/.markdownlint.yaml.trunk/configs/.yamllint.yaml.trunk/trunk.yamldocs/headscale-0.29.x-agentic-workplan.mde2e/docker.spec.tse2e/mock-api.mjse2e/navigation.spec.tslogo.svgopenapiv2.jsonsrc/lib/cards/node/NodeListCard.sveltesrc/lib/cards/node/NodeOwner.sveltesrc/lib/cards/node/NodeTileCard.sveltesrc/lib/cards/user/UserListNodes.sveltesrc/lib/cards/user/UserTileCard.sveltesrc/lib/common/acl.svelte.tssrc/lib/common/policy-document.test.tssrc/lib/common/policy-document.tssrc/lib/parts/NodeTagsIcon.sveltesrc/lib/parts/TagBadge.sveltesrc/routes/acls/+page.sveltesrc/routes/acls/Config.sveltesrc/routes/users/+page.svelteTest evidence
Executed in Node 20 Alpine container:
vitest src/lib/common/policy-document.test.tsvitest src/index.test.ts src/lib/common/policy-document.test.tsKnown limitations
acls[]/ssh[]entries.Follow-up recommendations
Non-goals